<?php
/**
* 	Light Blue Portal
* 	by VSMC DnS Team
* 	(c) 2008 Vietnam Social Media Company, JSC.
* 	@author				Nhan, Vo Chi
* 	@version			2.0
*   @package			LBP
*   @subpackage			Control
*/
  

/**
*
*   @desc				HTML Editor Control
*	@author				Nhan, Vo Chi
*   @version			2.0
*   @package			LBP
*   @subpackage			Control
*/
class lbp_control_editor
{
    private $util;
    public $value = "";
    public $options = array(
		'id'						=>		'content',
		'textarea_name'				=>		'content',
		'use_resize'				=>		false,
		'use_format'				=>		false,
		'use_fontface'				=>		false,
		'use_fontsize'				=>		false,
		'use_image'					=>		false,
		'use_color'					=>		false,
		'use_list'					=>		false,
		'use_align'					=>		false,
		'use_float'					=>		false,
		'use_help'					=>		false,
		'use_count'					=>		false,
		'max_length'				=>		30000,
		'help_link'					=>		'',
		'help_caller'				=>		'browser',
		'css_url'					=>		'../static-html/styles/editor_body.css'
	);

    /**
	*   @desc       constructor
	*
	*   @access		public
	*   @param		void
	*   @returns	void
	*/
	public function __construct($value="", $options=array())
	{
		$this->value = $value;
		$this->set_options($options);
        $this->util = new util();

	}

    /**
	*   @desc       return the HTML of the control
	*   @access		public
	*   @param		void
	*   @returns	void
	*/
	public function get_html()
	{
		$this->util->send_pointer("editor", $this);
		return $this->util->generate_page("../templates/global/editor.tpl");
	}
    protected function set_options($options){
        $this->options = array_merge($this->options, $options);
    }
}

?>